In data networks such as Internet, it is in practice mandatory to have information security measures in place in order to secure proprietary information and to defend against malicious intruders.
An applet is a little application. On the Web (WWW, World Wide Web), using Java, the object-oriented programming language, an applet is a small program that can be sent from a Web server along with a Web page to a user. Java applets can perform interactive animations, immediate calculations, or other simple tasks without having to send a user request back to the server. When a browser requests a Web page with applets, the applets are sent automatically and can be executed as soon as the page arrives in the browser. If the applet is allowed unlimited access to memory and system resources, it can do harm in the hands of someone with malicious intent. For the sake of security, applets are run in “a sandbox”, where the applet has only limited access to system resources. The sandbox creates an environment in which there are strict limitations on what system resources the applet can request or access. Sandboxes are used when executable code comes from unknown or untrusted sources and allow the user to run untrusted code safely. However, not all functionality of an applet can be denied even in sandbox. For example, an applet may need to open new outward connections towards the server they originated from.
FTP is an example of commonly used transfer protocols, which consist of more than one separate connection. In such protocols, a first connection is opened and then at least one other connection is opened on the basis of information obtained from or transferred within the first connection. That is, some attributes, such as port numbers, of the other connection are negotiated within the first connection. These are herein referred to as a control connection (the first connection) and a related connection (the other connection). In FTP, the related connection is often called data connection. Such a related connection is always related to some control connection and does not exist alone in a sense that opening the related connection requires intervention of the control connection. In addition, one related connection may be a control connection of another related connection. This concerns for example H.323 protocol. In these protocols, the attributes of related connections usually change dynamically. For example it is usually not known beforehand to which port a related connection will be established. Also the direction in which a related connection is opened may vary.
A firewall is traditionally considered as a set of components forming a gateway between two or more networks, which have different security requirements. Thus, a firewall is a gateway which operates at the same time as a connector and a separator between the networks in a sense that the firewall keeps track of the traffic that passes through it from one network to another and restricts connections and packets that are defined as unwanted by the administrator of the system. A firewall can be also so called personal firewall, which sits in an individual device, which needs to be protected, and monitors only connections going in to or coming out from that device. The operation of such personal firewall is in principle similar to the operation of a gateway firewall.
A firewall is configured by means of rules, which define which data packets are allowed to traverse the firewall and which are not. A rule comprises information for identifying a data packet (e.g. source and destination addresses and ports) and an associated action, which may be for example to allow or deny the packet. A firewall may be a simple packet filter, which compares header fields of a data packet to the firewall rules and processes the data packet according to the rule, which matches the data packet. A more advanced, stateful, firewall keeps track also on the state of different connections.
In a stateful firewall for example an FTP data connection is allowed only if negotiation of such data connection is noticed within a legitimate control connection. Other protocols comprising of more than one connection are treated similarly to FTP connections in stateful firewalls.
The use of protocols, which open related connections, creates vulnerability in a device, which is running applets, irrespective of whether a firewall is protecting the device or not. Let consider following scenario for illustrating this:                A Java applet is delivered to a client browser,        The Java applet acts as an FTP client and opens a control connection to the server,        A data connection from the server to the client is negotiated for a port in which some other vulnerable service is running (previous experimentation or even an educated guess can be used for finding out such port),        for an outside process, the data connection seems perfectly legitimate, since it was negotiated within a legitimate control connection, and thus it is allowed to traverse any firewall, either gateway or personal.        
Thus the server is allowed to open a connection to a port, where a vulnerable service is running. In some cases connections to ports below 1024 are denied in a firewall, but plenty of vulnerable services can be found also in ports above 1024.
One solution for tackling this vulnerability is to block all related connections. The disadvantage of this solution is that it blocks also all legitimate use of some important protocols. In many cases this is not a viable solution. In case of FTP blocking active FTP would help, but then not even legitimate active FTP connections would be allowed and still related connections associated with other protocols could be exploited. (FTP connections are classified into passive and active; in passive FTP the data connection is opened to the same direction with the control connection and in active FTP the data connection is opened to the opposite direction with the control connection.) Another partial solution would be to monitor related connections and allow them only if data is going only in one direction. This would make malicious use of FTP more complex, since in legitimate FTP data connections data is going only in one direction, but it would not help in relation to protocols in which data is transferred bi-directionally in the related connections. And even FTP attacks would not be disabled by this solution, since past experience has proven that it is possible to craft an attack, which transmits data only to the target and does not require any return traffic.
Thus, a new solution for tackling this problem is needed.